#{extends 'main.html' /}
#{if isOldOffer}
#{set title:'Offer Edited' /}
#{/if}
#{else}
#{set title:'Offer Created' /}
#{/else}
<div id="content">
  <div id="main" style="padding-top:0px">
    <div class="post" style="padding:top:0px">
      <h3 style="padding-top:0px;">
	#{if !isOldOffer}
	Your offer was successfully edited
	#{/if}
	#{else}
	Your offer was successfully created
	#{/else}
      </h3>
      <form>
	<ul class="long_login">
	  <li>
	    <label>Offer Title</label>
	    <input class="roinput" type="text" readonly="readonly" value="${offerItem.title}" />
	  </li>
	  <li>
	    <label>Offer Tags</label>
	    <input class="roinput" type="text" readonly="readonly" value="${offerItem.tags.join(' ')}" />
	  </li>
	  <li>
	    <label style="vertical-align: top; padding-top: 7px;">Description</label>
	    <textarea rows="4" class="roinput" readonly="readonly">${offerItem.description}</textarea>
	  </li>
	  <li>
	    <label>Honey Combs</label>
	    <input class="roinput" type="text" readonly="readonly" value="${offerItem.credit}" />
	  </li>
	  <li>
	    <label>Is Virtual?</label>
	    <input id="txtVirtual" class="roinput" type="text" readonly="readonly" />
	    <input type="checkbox" style="visibility: hidden; display: none" id="chkVir" ${offerItem.is_virtual ? 'checked':''} />
	  </li>	 
	  #{if offerItem.county_name}
	  <li>
	    <label>County</label>
	    <input class="roinput" type="text" readonly="readonly" value="${offerItem.county_name}" />
	  </li>
	  #{/if}
	  #{if offerItem.district_name}
	  <li>
	    <label>District</label>
	    <input class="roinput" type="text" readonly="readonly" value="${offerItem.district_name}" />
	  </li>
	  #{/if}	
	   <li>
	    <label style="vertical-align: top; padding-top: 5px;">Valid Until</label>
	    <input class="roinput" type="text" readonly="readonly" value="${offerItem.endDate.format('dd MMMM yyyy')}" />
	  </li>	 	  
	  <li>
	    <label>Is Reoccurrent?</label>
	    <input id="txtRec" class="roinput" type="text" readonly="readonly" />
	    <input type="checkbox" style="visibility: hidden; display: none" id="chkRec" ${offerItem.reoccure ? 'checked':''} />
	  </li>	  
	  <li>
	  		<label id="lblDays1" class="roinput" style=" position:relative;left:113px; width:339px; display:block;padding-top:6px;">
            <span id="spnDays">&nbsp;Monday&nbsp;&nbsp;
       		<input id="chkMonday" onclick='disableClick(this);' style="width:13px;height:13px;padding:0;margin:0;vertical-align:bottom;position:relative;top:-4px;*overflow:hidden;border:none;" 
       			   type="checkbox" name="offerItem.is_rec_monday" ${offerItem.is_rec_monday ? 'checked':''} />&nbsp;Tuesday
       		<input id="chkTuesday" onclick='disableClick(this);'  style="width:13px;height:13px;padding:0;margin:0;vertical-align:bottom;position:relative;top:-4px;*overflow:hidden;border:none;" 
       			   type="checkbox" name="offerItem.is_rec_tuesday" ${offerItem.is_rec_tuesday ? 'checked':''}/>&nbsp;Wednesday
       		<input id="chkWednesday" onclick='disableClick(this);' style="width:13px;height:13px;padding:0;margin:0;vertical-align:bottom;position:relative;top:-4px;*overflow:hidden;border:none;" 
       			   type="checkbox" name="offerItem.is_rec_wednesday" ${offerItem.is_rec_wednesday ? 'checked':''}/></span></label>  
       		<label id="lblDays2" class="roinput" onclick='disableClick(this);' style="position:relative;left:113px; width:339px; padding-top:7px;padding-bottom:7px; display:block;">&nbsp;Thursday
       		<input id="chkThursday" onclick='disableClick(this);' style="width:13px;height:13px;padding:0;margin:0;vertical-align:bottom;position:relative;top:-4px;*overflow:hidden;border:none;" 
       			   type="checkbox" name="offerItem.is_rec_thursday" ${offerItem.is_rec_thursday ? 'checked':''}/>&nbsp;Friday&nbsp;&nbsp;&nbsp;
       		<input id="chkFriday" onclick='disableClick(this);'  style="width:13px;height:13px;padding:0;margin:0;vertical-align:bottom;position:relative;top:-4px;*overflow:hidden;border:none;" 
       			   type="checkbox" name="offerItem.is_rec_friday" ${offerItem.is_rec_friday ? 'checked':''}/>&nbsp;Saturday&nbsp;&nbsp;&nbsp;
       		<input id="chkSaturday" onclick='disableClick(this);'  style="width:13px;height:13px;padding:0;margin:0;vertical-align:bottom;position:relative;top:-4px;*overflow:hidden;border:none;" 
       			   type="checkbox" name="offerItem.is_rec_saturday" ${offerItem.is_rec_saturday ? 'checked':''}/>&nbsp;Sunday
       		<input id="chkSunday" onclick='disableClick(this);'  style="width:13px;height:13px;padding:0;margin:0;vertical-align:bottom;position:relative;top:-4px;*overflow:hidden;border:none;" 
       			   type="checkbox" name="offerItem.is_rec_sunday" ${offerItem.is_rec_sunday ? 'checked':''}/></label>
	  </li>
	   	<li id="liRecTime">    		
	      		<label>Rec. Between</label> 		
	      	    <input class="roinput" type="text" readonly="readonly" value="${offerItem.reocc_start_hour} - ${offerItem.reocc_end_hour}"  />
	      	    <input style="display:none; visibility: hidden" id="txtRecFrom" type="text" readonly="readonly" value="${offerItem.reocc_start_hour}"  />
	      	    <input style="display:none; visibility: hidden" id="txtRecTo" type="text" readonly="readonly" value="${offerItem.reocc_end_hour}"  />
	    </li>  
	  
	  <script>
	  	if(document.getElementById("txtRecFrom").value == document.getElementById("txtRecTo").value)	
		{
	  		document.getElementById("liRecTime").style.visibility = "hidden";
	  		document.getElementById("liRecTime").style.display= "none";
	  	}
	  
	    if(document.getElementById("chkRec").checked == 0)
	  	{
	  		document.getElementById("lblDays1").style.visibility = "hidden";
	  		document.getElementById("lblDays1").style.display= "none";
	  		document.getElementById("lblDays2").style.visibility = "hidden";
	  		document.getElementById("lblDays2").style.display = "none";
	  		
	  		document.getElementById("txtRec").value = "No";	  		
	  	}
	  	else 
 		{
		 	document.getElementById("txtRec").value = "Yes";
	  	}
	  	
	  	if(document.getElementById("chkVir").checked == 0)
	  	{	  		
	  		document.getElementById("txtVirtual").value = "No";	  		
	  	}
	  	else 
 		{
		 	document.getElementById("txtVirtual").value = "Yes";
	  	}
	  	
	  	function disableClick(input){
  		 input.checked == true ? input.checked = false : input.checked = true;
  		}
      </script>  	    
	  
	  <input style="visibility:hidden; display:none" type="button" value="Home" onclick="window.location='@{Application.index()}'"/>
      </form>
      
    </div>
  </div>
</div>
